package com.sojoys.artifact.tools;


import java.util.concurrent.CompletionStage;

import akka.actor.ActorRef;
import akka.pattern.Patterns;
import scala.compat.java8.FutureConverters;
import scala.concurrent.Future;
/**
 * @author : DengYing
 * @CreateDate : 2017年12月15日 下午1:47:07
 * @Description ：Please describe this document
 */
public class ToolAkka {
	
	public static CompletionStage<Object> ask(ActorRef actorRef,Object message,int timeOut) {
		Future<Object> future = Patterns.ask(actorRef, message, 1000);
		CompletionStage<Object> cs = FutureConverters.toJava(future);
		return cs;
	}
}
